package com.bestcem.xm.survey.grpc.client.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.bestcem.xm.survey.config.StringValue2FastJsonSerializer;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class QdesQuestionDto {
    /**
     * id
     */
    private String id;

    /**
     * type
     */
    @JSONField(name = "qtype")
    private String type;

    /**
     * current_template
     */
    @JSONField(name = "current_template", serializeUsing = StringValue2FastJsonSerializer.class)
    private String currentTemplate;

    /**
     * gid
     */
    private Integer gid;

    /**
     * title
     */
    private String title;

    /**
     * custom_qtype
     */
    @JSONField(name = "custom_qtype")
    private String customQtype;

    /**
     * cid
     */
    private String cid;

    /**
     * items
     */
    private List<QdesQuestionOptionDto> items;

    /**
     * row_items
     */
    @JSONField(name = "row_items")
    private List<QdesQuestionOptionDto> rowItems;

    /**
     * option_list
     */
    @JSONField(name = "option_list")
    private List<QdesCascaderOptionDto> optionList;

    /**
     * tag_list
     */
    @JSONField(name = "tag_list")
    private List<String> tags;

    @Data
    @NoArgsConstructor
    public static class QdesQuestionOptionDto {
        /**
         * gid
         */
        private Integer gid;

        /**
         * title
         */
        private String title;
    }

    @Data
    @NoArgsConstructor
    public static class QdesCascaderOptionDto {
        /**
         * gid
         */
        private Integer gid;

        /**
         * title
         */
        private String title;

        /**
         * pid
         */
        private String pid;

        /**
         * ooid
         */
        private String ooid;
    }
}
